<?php


namespace app\common\service\coupon;


use app\admin\model\store\GoodsCoupon;

class CouponContext
{
    private $couponDiscount;

    public function __construct(CouponDiscount $couponDiscount)
    {
        $this->couponDiscount = $couponDiscount;
    }

    /**
     * Author:YangXinPeng
     * 折扣入口
     * @param $coupon
     * @param $price
     * @return mixed
     */
    public function prefere($coupon,$price)
    {
      return $this->couponDiscount->discountAmount($coupon,$price);
    }
}